package edu.calvin.djs32.cs214.interpreters.calculator.primitives;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import edu.calvin.cs214.hobbes2008.IntegerTIR;
import edu.calvin.cs214.hobbes2008.StringTIR;
import edu.calvin.cs214.hobbes2008.TupleTIR;


public class EqualsToPrimitiveTest {
	@Test
	public void shouldApplyInteger(){
		assertEquals(new TupleTIR(), new EqualsToPrimitive().apply(null, new IntegerTIR(2), new IntegerTIR(3)));
		assertEquals(new TupleTIR(), new EqualsToPrimitive().apply(null, new IntegerTIR(-2), new IntegerTIR(33)));
		assertEquals(new StringTIR("true"), new EqualsToPrimitive().apply(null, new IntegerTIR(-3), new IntegerTIR(-3)));
	}
	
	@Test
	public void shouldApplyString(){
		assertEquals(new TupleTIR(), new EqualsToPrimitive().apply(null, new StringTIR("foo"), new StringTIR("fooo")));
		assertEquals(new StringTIR("true"), new EqualsToPrimitive().apply(null, new StringTIR("foo"), new StringTIR("foo")));
	}


}
